PREFIX  = /usr/local
#PREFIX  = ~/gcc-4.6

ARCH    = h8300-elf
BINDIR  = $(PREFIX)/bin
ADDNAME = $(ARCH)-

AR      = $(BINDIR)/$(ADDNAME)ar
AS      = $(BINDIR)/$(ADDNAME)as
CC      = $(BINDIR)/$(ADDNAME)gcc
LD      = $(BINDIR)/$(ADDNAME)ld
NM      = $(BINDIR)/$(ADDNAME)nm
OBJCOPY = $(BINDIR)/$(ADDNAME)objcopy
OBJDUMP = $(BINDIR)/$(ADDNAME)objdump
RANLIB  = $(BINDIR)/$(ADDNAME)ranlib
STRIP   = $(BINDIR)/$(ADDNAME)strip
READELF = $(BINDIR)/$(ADDNAME)readelf

CFLAGS  = -Wall -mh -fno-hosted
#CFLAGS += -Wno-pointer-sign
#CFLAGS += -malign-300
#CFLAGS += -mint32
#CFLAGS += -mrelax
#CFLAGS += -mslowbyte
#CFLAGS += -g
CFLAGS += -Os
CFLAGS += -fomit-frame-pointer
CFLAGS += -DKOZOS
#CFLAGS += -DNOASSERT
CFLAGS += -I. -I$(COMMONDIR)

VPATH = $(COMMONDIR)

.SUFFIXES:
.SUFFIXES: .o .c .s .S

.c.o :      $<
			$(CC) -c $(CFLAGS) $< -o $@

.s.o :      $<
			$(CC) -c $(CFLAGS) $< -o $@

.S.o :      $<
			$(CC) -c $(CFLAGS) $< -o $@
